﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WriteLog
{
    public class BugMessage : BaseLogMessage
    {
        public BugMessage(string message)
            :this("NoApplicationName",0,"无",message)
        { 
        }

        public BugMessage(string provider, int eventID, string taskName, string messageBody)
        {
            this.Provider = provider;
            this.EventID = eventID;
            this.TaskName = taskName;
            string threadName = System.Threading.Thread.CurrentThread.Name;
            string threadID = System.Threading.Thread.CurrentThread.ManagedThreadId.ToString();
            this.MessageBody = string.Format("[线程ID：{0},{1}]{2}", threadID,threadName, messageBody);
        }

        public BugMessage(Exception e)
            : this(e.Source,0,string.Format("{0}|{1}",e.Source,e.GetType().Name),e.Message)
        {
        }


        public override LogLevel Level
        {
            get
            {
                return LogLevel.Bug;
            }
        }
    }
}
